package chen.web.config.spring;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import chen.web.config.ConfigRepository;
import chen.web.config.SystemConfig;
import chen.web.event.EventSupport;
import chen.web.user.AccountManager;
import chen.web.user.SessionSupport;

@Configuration
public class SessionSupportConfig {
	
	private @Autowired AccountManager am;
	private @Autowired EventSupport es;
	
	public @Bean SessionSupport sessionSupport(){
		int sessionTimeout = ConfigRepository.instance().get(SystemConfig.class).getSessionTimeOut();
		return new SessionSupport(am, sessionTimeout, es);
	}
}
